<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Class与Style绑定</title>
</head>
<body>
<div id="example">
    <p class="one {{c}}" v-bind:class="classObject">绑定HTML Class</p>
    <p v-bind:class="[c,d]">绑定HTML Class 数组语法</p>
    <p v-bind:style="styleObject">绑定内联样式</p>
    <p v-bind:style="[styleObjectA, styleObjectB]">绑定内联样式(将多个样式应用到一个对象上)</p>
</div>
<script src="../js/libs/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#example',
        data: {
            styleObject: {
                color: 'red',
                fontSize: '32px'
            },
            styleObjectA: {
                border: '10px solid gray',
                width: '320px'
            },
            styleObjectB: {
                backgroundColor: 'green',
                boxShadow: '0 0 10px gray'
            },
            classObject: {
                'a': true,
                'b': false
            },
            c: 'two',
            d: 'three'
        }
    });
</script>
</body>
</html>